package com.sojson.project.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.project.dao.ActivityUserDao;
import com.sojson.project.entity.po.ActivityUser;
import com.sojson.project.service.ActivityUserService;

/**
 * 券可用用户Service实现类
 * 
 * @author liu
 * @date 2021-06-08
 */
@Service
public class ActivityUserServiceImpl implements ActivityUserService {

    @Resource
    private ActivityUserDao activityUserDaoImpl;

    /**
     * 单条插入
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int insert(ActivityUser activityUser) {
        int insert = activityUserDaoImpl.insert(activityUser);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int insertList(ActivityUser activityUser) {
        int insertList = activityUserDaoImpl.insertList(activityUser.getActivityUsers());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int deleteByDto(ActivityUser activityUser) {
        int deleteByDto = activityUserDaoImpl.deleteByDto(activityUser);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = activityUserDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<ActivityUser> listAll() {
        List<ActivityUser> findAll = activityUserDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int countByDto(ActivityUser activityUser) {
        int countByDto = activityUserDaoImpl.countByDto(activityUser);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param activityUser
     * @return
     */
    @Override
    public List<ActivityUser> listByDto(ActivityUser activityUser) {
        List<ActivityUser> findByDto = activityUserDaoImpl.listByDto(activityUser);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = activityUserDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id数组删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        int deleteByIds = activityUserDaoImpl.deleteByIds(ids);
        return deleteByIds;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateAllById(ActivityUser activityUser) {
        int updateAllById = activityUserDaoImpl.updateAllById(activityUser);
        return updateAllById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateAllByIdList(ActivityUser activityUser) {
        int updateAllByIdList = activityUserDaoImpl.updateAllByIdList(activityUser);
        return updateAllByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateDtoListAllById(ActivityUser activityUser) {
        int updateDtoListAllById = activityUserDaoImpl.updateDtoListAllById(activityUser.getActivityUsers());
        return updateDtoListAllById;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateById(ActivityUser activityUser) {
        int updateById = activityUserDaoImpl.updateById(activityUser);
        return updateById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateByIdList(ActivityUser activityUser) {
        int updateByIdList = activityUserDaoImpl.updateByIdList(activityUser);
        return updateByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param activityUser
     * @return
     */
    @Override
    public int updateDtoListById(ActivityUser activityUser) {
        int updateDtoListById = activityUserDaoImpl.updateDtoListById(activityUser.getActivityUsers());
        return updateDtoListById;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public ActivityUser findById(Integer id) {
        ActivityUser findById = activityUserDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id数组查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<ActivityUser> findByIds(Integer[] ids) {
        List<ActivityUser> findByIds = activityUserDaoImpl.findByIds(ids);
        return findByIds;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param activityUser
     * @return
     */
    @Override
    public List<Integer> findIdByDto(ActivityUser activityUser) {
        List<Integer> findIdByDto = activityUserDaoImpl.findIdByDto(activityUser);
        return findIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public int clear() {
        return activityUserDaoImpl.clear();
    }

    /**
     * 根据对象查询
     * 
     * @param activityUser
     * @return
     */
    @Override
    public List<ActivityUser> list(ActivityUser activityUser) {
        return activityUserDaoImpl.list(activityUser);
    }

}